import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
     component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },{
      path:'/test',
      name:'test',
      component:()=>import('../views/test/Test.vue')
  },{
        path:'/grid',
        name:'grid',
        component:()=>import('../views/grid/Grid.vue')
    },{

        path:'/form',
        name:'form',
         component:()=>import('../views/data/Form.vue')
    },{
        path:'/query',
        name:'query',
         component:()=>import('../views/data/Query.vue')
    },{
        path:'/table',
        name:'table',
         component:()=>import('../views/data/Table.vue')
    },{
         path:'/modal',
         name:'modal',
         component:()=>import('../views/data/Dialog.vue')
    },{
          path:'/layout',
         name:'layout',
         component:()=>import('../views/layout/Layout.vue')
    },{
            path:'/data',
            name:'data',
           component:()=>import('../views/layout/Layout.vue'),
           children:[
               {
                   path:'table',
                   name:'table',
                   component:()=>import('../views/data/Table.vue')
               },{
                   path:'query',
                   name:'query',
                   component:()=>import('../views/data/Query.vue')
               }
           ]
    }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
